
//
//  UIButton+Extension.swift
//  TJSinaWeibo
//
//  Created by 唐后能 on 16/4/15.
//  Copyright © 2016年 itheima. All rights reserved.
//

import UIKit

extension UIButton {

    convenience init(content:String,bgImgnName:String,bgHigllightImgName:String,ImgName:String,fontSize:CGFloat = 12){
        self.init(frame: CGRectZero)
        setTitle(content, forState: UIControlState.Normal)
        setBackgroundImage(UIImage(named: bgImgnName), forState: UIControlState.Normal)
        setBackgroundImage(UIImage(named: bgHigllightImgName), forState: UIControlState.Highlighted)
        setImage(UIImage(named: ImgName), forState: UIControlState.Normal)
        // 设置文字大小和颜色
        setTitleColor(UIColor.lightGrayColor(), forState: UIControlState.Normal)
        titleLabel?.font = UIFont.systemFontOfSize(fontSize)
    }
}
